

$(function(){
	$("#addArticleForm").submit(function(){
		var url=$(this).attr("action");
		var typeId=$("#typeId").val();
		var title=$("input[name='title']").val();
		var content=$("textarea[name='content']").val();
		$.ajax({
			type:'post',
			url:url,
			data:"typeId="+typeId+"&title="+title+"&content="+content,
			success:function(data){
				layer.msg(data.message);
				if(data.status=="200"){
					$("input[name='title']").val("");
					$("textarea[name='content']").val("");
					$("#myModal").modal("hide");
					location.replace(location.href);
				}
			}
		});
		return false;
	});
});


